home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.7 KB | 212 lines | [TEXT/MPS ] |
- //
- // File: SLFilesp.idl
- //
- // Contains: Interfaces for FW_OFileSpecification and FW_ODirectorySpecification classes
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
-
- #ifndef SLFILESP_IDL
- #define SLFILESP_IDL
-
- #ifndef SLSTDDEF_IDL
- #include "SLStdDef.idl"
- #endif
-
- #ifndef SLTXTTYP_IDL
- #include "SLTxtTyp.idl"
- #endif
-
- #include <somobj.idl>
- #include <somcls.idl>
-
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- interface FW_OFileSpecification;
- interface FW_ODirectorySpecification;
-
-
- //==============================================================================
- // Types used by this interface
- //==============================================================================
-
- typedef somToken FW_CPrivFileSpecification;
- // typedef somToken FW_CString;
- typedef somToken FSSpec;
-
-
- //========================================================================================
- // FW_OFileSpecification
- //
- // This class is used to identify a disk-based file.
- //========================================================================================
-
- interface FW_OFileSpecification : SOMObject
- {
- void InitFromFileName(in FW_HString fileName);
- // Create a file specification from a full or partial pathname. In the case of
- // a partial pathname, the specification will use the current default
- // directory to build a full pathname.
-
- void InitFromDirectoryAndName(in FW_ODirectorySpecification directory,
- in FW_HString fileName);
- // Create a file specification from a directory and a file name. The file name
- // should include any extensions that might be necessary.
-
-
- void GetName(out FW_HString fileName);
- // Get the name of the file.
-
- FW_ODirectorySpecification GetParentDirectory();
- // Returns the path information for this file.
-
- void GetFullPath(out FW_HString fullPathName);
- // Returns the fully qualified path and file name for this file. The user should
- // pass in a dynamic string so as to guarantee that the path will fit inside
- // it.
-
-
- //===========================================================
- // Operators
- //===========================================================
-
- FW_Boolean IsSameAs(in FW_OFileSpecification theOtherFile);
- // Does this file represent the same file as theOtherFile.
-
- void AssignOFileSpecification(in FW_OFileSpecification theOtherFile);
- // Copy all of the file information from theOtherFile so that this file spec
- // represents the same file. (Use this for the copy constructor).
-
- void AssignFileName(in FW_HString fileName);
- // Change the name of this file to fileName. fileName may be a partial pathName.
- // This does not change any of the existing path information.
-
-
- #ifdef FW_BUILD_WIN
- char WinGetDrive();
- // Get the letter of the drive this file is on and return it as a lower-case
- // character.
-
- void WinGetExtension(out FW_HString extension);
- // Get the file name extension for the Windows file.
-
- void WinSetExtension(in FW_HString extension);
- // Set the file name extension for the Windows file.
- #endif
-
- #ifdef FW_BUILD_MAC
- void AssignFileSpec(in FSSpec* macSpec);
- // This specifier will now represent the file described by macSpec.
-
- void MacGetFSSpec(out FSSpec macSpec);
- // Return a Macintosh FSSpec that points to this file.
-
- void MacSetTypeAndCreator(in FW_ResourceType aFileType, in FW_ResourceType aCreatorType);
- void MacGetTypeAndCreator(out FW_ResourceType aFileType, out FW_ResourceType aCreatorType);
- // Accessors to the type and creator of the file specification.
- #endif
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = FW_OFileSpecification__;
-
- override:
- somInit,
- somUninit;
-
- releaseorder:
- somInit,
- somUninit,
-
- InitFromFileName,
- InitFromDirectoryAndName,
- GetName,
- GetParentDirectory,
- GetFullPath,
- IsSameAs,
- AssignOFileSpecification,
- AssignFileName,
-
- #ifdef FW_BUILD_WIN
- WinGetDrive,
- WinGetExtension,
- WinSetExtension;
- #endif
-
- #ifdef FW_BUILD_MAC
- AssignFileSpec,
- MacGetFSSpec,
- MacSetTypeAndCreator,
- MacGetTypeAndCreator;
- #endif
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "class FW_CPrivFileSpecification;";
-
- #ifdef __PRIVATE__
- FW_CPrivFileSpecification *fRep;
- #endif
- };
- #endif //# __SOMIDL__
- };
-
-
- //========================================================================================
- // FW_ODirectorySpecification
- //
- // This class is used to indentify a disk-based directory. A directory uses most of the
- // same information as a file specification, but is not a file. However, we inherit
- // from FW_OFileSpecification for reuse. (SOM doesn't have private inheritance).
- //========================================================================================
- interface FW_ODirectorySpecification : FW_OFileSpecification
- {
- //===========================================================
- // Operators
- //===========================================================
-
- void AppendDirectoryName(in FW_HString directoryName);
- // Add directoryName to the end of this path. This routine will add a path
- // separator so that the user does not need to. The remaining path information
- // may specify a subdirectory or parent directory, but must start from this
- // directory.
-
- #ifdef __SOMIDL__
- implementation
- {
- functionprefix = FW_ODirectorySpecification__;
-
- override:
- somInit,
- GetFullPath;
-
- releaseorder:
- AppendDirectoryName;
-
- majorversion = 1;
- minorversion = 0;
-
- passthru C_xh =
- "";
-
- passthru C_xih =
- "";
-
- #ifdef __PRIVATE__
- #endif
- };
- #endif //# __SOMIDL__
- };
-
- #endif
-